{extend name="layout" /}

{block name="breadcrumb"}
<h2>添加订单</h2>
<ol class="breadcrumb">
    <li><a href="{:url('index/index')}">首页</a></li>
    <li><a href="{:url('index')}">订单列表</a></li>
    <li><strong>添加订单</strong></li>
</ol>
{/block}

{block name="main"}
<div class="ibox float-e-margins">
    <div class="ibox-title">
        <h5>添加订单</h5>
    </div>
    <div class="ibox-content">
        <form method="post" class="form-horizontal" onsubmit="return toSubmit()">
            <div class="form-group">
                <label class="col-sm-2 control-label">用户</label>
                <div class="col-sm-6">
                    <input type="text" readonly class="form-control" value="{$oauth.nickname} | {$oauth.phone}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">语种</label>
                <div class="col-sm-6">
                    <select name="lang_id" class="form-control" required>
                        {foreach $lang as $key => $value}
                        <option value="{$key}">{$value}</option>
                        {/foreach}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">选择班级</label>
                <div class="col-sm-6">
                    {foreach $class as $key => $value}
                    <div class="checkbox checkbox-primary checkbox-inline">
                        <input id="type{$key}" type="checkbox" value="{$key}" name="type[]" class="checkbox-item">
                        <label for="type{$key}">{$value}</label>
                    </div>
                    {/foreach}
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">教导主任</label>
                <div class="col-sm-6">
                    <select name="customer_id" class="form-control">
                        <option value="0">不选择</option>
                        {foreach $customer as $key => $value}
                        <option value="{$key}">{$value}</option>
                        {/foreach}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">积分抵扣</label>
                <div class="col-sm-6">
                    <div class="radio radio-primary radio-inline">
                        <input id="integral_yes" type="radio" value="{$reduceMoney}" name="integral" checked class="checkbox-item">
                        <label for="integral_yes">可抵扣<span class="text-danger"> {$reduceMoney} </span>积分<span id="integral-rest">（积分余额：{$oauth.integral}）</span></label>
                    </div>
                    <div class="radio radio-primary radio-inline">
                        <input id="integral_no" type="radio" value="0" name="integral" class="checkbox-item">
                        <label for="integral_no">不抵扣</label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">优惠券</label>
                <div class="col-sm-6">
                    <select name="coupon_id" class="form-control">
                        <option value="0">不选择</option>
                        {foreach $coupon as $key => $value}
                        <option value="{$value.id}">{$value.name}---{$value.money}</option>
                        {/foreach}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">支付方式</label>
                <div class="col-sm-6">
                    <select name="pay_type" class="form-control">
                        {foreach $payType as $key => $value}
                        <option value="{$key}">{$value}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否付费</label>
                <div class="col-sm-6">
                    <select name="pay_money_to" class="form-control required">

                        <option value="0">请选择</option>
                        <option value="1">未付费</option>
                        <option value="2">已付费</option>

                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">支付金额</label>
                <div class="col-sm-6">
                    <input type="text" name="pay_money" value="" class="form-control" required placeholder="请输入用户实际支付的金额"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">订单备注</label>
                <div class="col-sm-6">
                    <textarea name="remark" id="" rows="5" class="form-control"></textarea>
                </div>
            </div>

            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    <input type="hidden" name="oauth_id" value="{$oauth.id}" class="form-control"/>
                    <button class="btn btn-primary" type="submit">提交</button>
                    <button class="btn btn-white" type="button"><a href="{:url('index')}">取消</a></button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}


